package io.github.doc.action.language.visitor;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.PsiFile;

/**
 * <p>Company: 深圳振瀚信息技术有限公司成都分公司 </p>
 * <p>Description: </p>
 *
 * @author ZH.Team
 * @version 1.0.0
 * @email "mailto:ZH.Team@zhxx.com"
 * @date 2025.01.05 17:35
 * @since y.y.y
 */
public interface Visitor<T extends PsiElement, F> {

    /**
     * Support
     *
     * @param file file
     * @return the boolean
     * @since y.y.y
     */
    boolean support(PsiFile file);

    /**
     * Gets element factory *
     *
     * @return the element factory
     * @since y.y.y
     */
    F getElementFactory();

    /**
     * 当前文件生成
     *
     * @param psiFile     psi file
     * @param actionEvent action event
     * @return the element visitor
     * @since y.y.y
     */
    PsiElementVisitor generateFileElementVisitor(T psiFile, AnActionEvent actionEvent);

    /**
     * 当前元素生成
     *
     * @param psiFile     psi file
     * @param actionEvent action event
     * @return the psi element visitor
     * @since y.y.y
     */
    PsiElementVisitor generateElementVisitor(T psiFile, AnActionEvent actionEvent);

    /**
     * 删除当前文件的注释
     *
     * @param psiFile     psi file
     * @param actionEvent action event
     * @return the psi element visitor
     * @since y.y.y
     */
    PsiElementVisitor deleteFileElementVisitor(T psiFile, AnActionEvent actionEvent);

    /**
     * 删除当前元素的注释
     *
     * @param psiFile     psi file
     * @param actionEvent action event
     * @return the psi element visitor
     * @since y.y.y
     */
    PsiElementVisitor deleteElementVisitor(T psiFile, AnActionEvent actionEvent);
}
